import { Role, RoleVO, RoleDTO } from './model/roleModel';
import { defHttp } from '/@/utils/http/axios';

enum Api {
  List = '/sys/role/list',
  Save = '/sys/role/save',
  Del = '/sys/role',
  AllList = '/sys/role/allList',
}

// 菜单树
export const roleList = (params?: RoleVO) => defHttp.post<RoleDTO>({ url: Api.List, params });

// 保存
export const roleSave = (params: Role) => defHttp.post<Role>({ url: Api.Save, params });

// 删除
export const roleDel = (params: { ids: String }) =>
  defHttp.delete<boolean>({ url: Api.Del + `/${params.ids}` });

// 查询所有角色列表
export const roleAllList = (params?: RoleVO) => defHttp.get<RoleDTO>({ url: Api.AllList, params });
